package com.first.xiinn.model;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.first.core.web.model.BaseModel;
import com.google.gson.annotations.Expose;

public class BookManager extends BaseModel {
	
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Expose
	protected String id;
    /**
     * 书籍名称
     */
    @Expose
	protected String name;
    /**
     * 书籍简介
     */
    @Expose
	protected String bookSynopses;
    
    @Expose
   	protected String parentId;
    /**
     * 作者
     */
    @Expose
    protected String author; 
    
    protected String authorName;
    /**
     * 作者简介
     */
    @Expose
    protected String authorSynopses;  
    /**
     * 译者
     */
    @Expose
    protected String translator;
    /**
     * 出版社
     */
    @Expose
    protected String publishing;
    /**
     * 出版时间
     */
    @Expose
    protected Date  publishingDate;
    
    protected String publishingDateStr;
    /**
     * 图书编号
     */
    @Expose
    protected String  isbn;
    /**
     * 定价
     */
    @Expose
    protected float price; 
    /**
     * 添加时间
     */
    @Expose
    protected Timestamp addTime;
	/**
     *书籍分类
     */
    @Expose
   	protected String type;
    
    protected String typeName;
    /**
     * 页数
     */
    protected String  pageCount;
    /**
     * 装帧
     */
    protected String binding;
	/**
     *封面图片
     */
    @Expose
    protected String pto;
    /**
     *书籍电子版
     */
    @Expose
    protected String electronic;
    
    public String getPto() {
		return pto;
	}

	public void setPto(String pto) {
		this.pto = pto;
	}

	public String getBookSynopses() {
		return bookSynopses;
	}

	public void setBookSynopses(String bookSynopses) {
		this.bookSynopses = bookSynopses;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getAuthorSynopses() {
		return authorSynopses;
	}

	public void setAuthorSynopses(String authorSynopses) {
		this.authorSynopses = authorSynopses;
	}

	public String getTranslator() {
		return translator;
	}

	public void setTranslator(String translator) {
		this.translator = translator;
	}

	public String getPublishing() {
		return publishing;
	}

	public void setPublishing(String publishing) {
		this.publishing = publishing;
	}

	public Date getPublishingDate() {
		return publishingDate;
	}

	public void setPublishingDate(Date publishingDate) {
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		if(publishingDate!=null){
			publishingDateStr = format.format(publishingDate);
		}
		this.publishingDate = publishingDate;
	}

	public String getIsbn() {
		return isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public Timestamp getAddTime() {
		return addTime;
	}

	public void setAddTime(Timestamp addTime) {
		this.addTime = addTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getPublishingDateStr() {
		return publishingDateStr;
	}

	public void setPublishingDateStr(String publishingDateStr) {
		try{
			if(publishingDateStr!=null && !"".equals(publishingDateStr)){
				DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");     
				publishingDate = format1.parse(publishingDateStr);
			}
		}catch (ParseException e){
			System.out.println(e.getMessage());
		}
		this.publishingDateStr = publishingDateStr;
	}

	public String getAuthorName() {
		return authorName;
	}

	public void setAuthorName(String authorName) {
		this.authorName = authorName;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getElectronic() {
		return electronic;
	}

	public void setElectronic(String electronic) {
		this.electronic = electronic;
	}

	public String getPageCount() {
		return pageCount;
	}

	public void setPageCount(String pageCount) {
		this.pageCount = pageCount;
	}

	public String getBinding() {
		return binding;
	}

	public void setBinding(String binding) {
		this.binding = binding;
	}
	
}